/**
 * @see https://umijs.org/zh-CN/plugins/plugin-access
 * */
export default function access(initialState) {
  console.log("====access=====")
  console.log(initialState)
  const { currentUser } = initialState || {};
  return {
    grs: currentUser && currentUser?.handleValues?.access === 'grs',
    irs: currentUser && (currentUser?.handleValues?.access === 'irs_admin' || currentUser?.handleValues?.access === 'irs_user'),
    irs_admin: currentUser && currentUser?.handleValues?.access === 'irs_admin',
    irs_user: currentUser && currentUser?.handleValues?.access === 'irs_user',
    reg: currentUser && (currentUser?.handleValues?.access === 'reg_admin' || currentUser?.handleValues?.access === 'reg_user'),
    reg_admin: currentUser && currentUser?.handleValues?.access === 'reg_admin',
    reg_user: currentUser && currentUser?.handleValues?.access === 'reg_user',
    repo: currentUser && (currentUser?.handleValues?.access === 'repo_admin' || currentUser?.handleValues?.access === 'repo_user'),
    repo_admin: currentUser && currentUser?.handleValues?.access === 'repo_admin',
    repo_user: currentUser && currentUser?.handleValues?.access === 'repo_user',
    normal_user: currentUser && currentUser?.handleValues?.access === 'normal_user',
    user: true
  };
}
